/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package desint;

import java.awt.Component;
import java.awt.event.MouseEvent;
import javax.swing.ImageIcon;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 *
 * @author lenny
 */
public class MyRenderer extends DefaultTableCellRenderer {
    /*
   * @see TableCellRenderer#getTableCellRendererComponent(JTable, Object, boolean, boolean, int, int)
   */
    private int type;
    
    public MyRenderer(int type){
        this.type= type;
    }
    
  public Component getTableCellRendererComponent(JTable table, Object value,
                                                 boolean isSelected, boolean hasFocus, 
                                                 int row, int column) {
    
      ImageIcon icon;
      if (type==1){
      icon = new ImageIcon("src/delete.png");
      } else {
      icon = new ImageIcon("src/edit.png");    
      }
      
   
    setIcon(icon);
    return this;
  }
    
}
